version: '3.8'
services:
  gateway:
    build: gateway
    image: shareit-gateway-image
    container_name: shareit-gateway
    ports:
      - "8080:8080"
      - "8081:8081"
    depends_on:
      - server
    environment:
      - SHAREIT_SERVER_URL=http://server:9090

  server:
    build: server
    image: shareit-server-image
    container_name: shareit-server
    ports:
      - "9090:9090"
      - "9091:9091"
    depends_on:
      - db
    environment:
      - DB_NAME=shareit
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=root
      - DB_HOST=db
      - DB_PORT=5432
      #- TZ=Europe/Moscow


  db:
    image: postgres:14
    container_name: db
    ports:
      - "6541:5432"
    environment:
      - TZ=Europe/Moscow
      - POSTGRES_DB=shareit
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=root